package com.qf.sy2103.Utils;

import com.qf.sy2103.entity.Man;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
//实现具体操作逻辑
public class Copy {
    public static void main(String[] args) throws IOException {
       copyone();
    }
    public static void copyone() throws IOException {
        BufferedReader reader = new BufferedReader(
                new FileReader(new File("2.txt")));
        String str;
        List<String > list = new ArrayList<>();
        while ((str = reader.readLine())!=null){
            list.add(str);
        }
        list.forEach(System.out::println);
        reader.close();
        BufferedWriter writer = new BufferedWriter(new FileWriter(
                new File("1.txt"),true));
        for (int i = 0; i<5000 ; i++){
            for (String s : list) {
                writer.write(s);
                writer.newLine();
            }
        }
        writer.flush();
        writer.close();
        System.out.println("over");
    }
}
